<!--
	作者：ZhangXin
	时间：2020-07-21
	描述：博客搜索页面
-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head th:replace="fragments::head(~{::title})">
    <title>搜索</title>
</head>

<body>
<!--导航-->
<nav th:replace="fragments::menu(0)"></nav>

<!--顶部图片-->
<div class="m-bg-type_outer" style="width: 100%;height: 40%">
    <img src="../static/images/searchbg.jpg" th:src="@{/images/searchbg.jpg}" alt="" class="ui m-bg image"
         style="width: 100%;height: 100%">
    <div class="m-bg-class_cover">
        <div class="ui container" style="position: relative ;bottom: -540px;">
            <div class="m-font-size-title m-right-bottom" align="center" style="font-family:'STXingkai'">搜索结果</div>
            <div class="m-font-size-text-init-title m-margin-top" align="center">人生，就是一个不断寻找的过程</div>
        </div>
    </div>
</div>
<!--中间内容-->
<div  class="m-margin-">
    <div class="ui container">
        <!--header-->
        <div class="ui top attached segment">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <h3 class="ui teal header">搜索结果</h3>
                </div>
                <div class="right aligned column">
                    共 <h2 class="ui orange header m-inline-block m-text-thin" th:text="${page.totalElements}"> 14 </h2> 篇
                </div>
            </div>
        </div>

        <div class="ui top attached segment m-opacity-mini">
            <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                <div class="ui middle aligned mobile reversed stackable grid" >
                    <div class="eleven wide column">
                        <h3 class="ui header" ><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}"></a></h3>
                        <p class="m-text m-margin-top-max" th:text="|${blog.description}......|"></p>
                        <div class="ui grid m-margin-top-max">
                            <div class="eleven wide column">
                                <div class="ui mini horizontal link list">
                                    <div class="item">
                                        <img src="../static/images/me.jpg" th:src="@{${blog.user.avatar}}"  alt="" class="ui avatar image">
                                        <div class="content"><a href="#" class="header" th:text="${blog.user.nickname}" >oneStar</a></div>
                                    </div>
                                    <div class="item">
                                        <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2020-01-01</span>
                                    </div>
                                    <div class="item">
                                        <i class="eye icon"></i> <span th:text="${blog.views}">2222</span>
                                    </div>
                                    <div class="item">
                                        <i class="comment outline icon"></i> <span th:text="${blog.comments.size()}">2222</span>
                                    </div>
                                </div>
                            </div>
                            <div class="right aligned five wide column">
                                <a href="#" target="_blank" class="ui teal basic label m-padded-tiny m-text-thin" th:text="${blog.type.name}">好文</a>
                            </div>
                        </div>
                    </div>

                    <!--博文首图-->
                    <div class="five wide column">
                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                            <img src="../static/images/001.jpg" th:src="@{${blog.firstPicture}}"  alt="" class="ui rounded image">
                        </a>
                    </div>

                </div>
            </div>
        </div>

        <!--页面切换-->
        <div class="ui bottom attached segment" th:if="${page.totalPages}>1">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <a href="#" th:href="@{/search (query=${query},(page=${page.number}-1))}"  th:unless="${page.first}" class="ui mini teal basic button">上一页</a>
                </div>
                <div class="right aligned column">
                    <a href="#" th:href="@{/search (query=${query},(page=${page.number}+1))}"  th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
                </div>
            </div>
        </div>

    </div>
</div>

<br>
<br>

        <!--底部内容-->
        <footer th:replace="fragments::footer"></footer>

        <script th:replace="fragments::script"></script>

        <script>
            $('.menu.toggle').click(function () {
                $('.m-item').toggleClass('m-mobile-hide')
            });

            $('.menu.toggle').click(function () {
                $('.m-item').toggleClass('m-mobile-show');

            });
        </script>
</body>

</html>